import request from '@/utils/request'

export function getInfo(id) {
  return request({
    url: '/book/' + id,
    method: 'get'
  })
}

export function getBookList(data) {
  return request({
    url: '/book',
    method: 'get',
    params: data
  })
}

export function addBookInfo(data) {
  return request({
    url: '/book',
    method: 'post',
    data: data
  })
}
export function delBookInfo(id) {
  return request({
    url: '/book/' + id,
    method: 'delete'
  })
}

export function editBookInfo(data) {
  return request({
    url: '/book/' + data.id,
    method: 'put',
    data: data.data
  })
}

// 修改图书分类
export function editBookCategory(data) {
  return request({
    url: '/editbook',
    method: 'put',
    data
  })
}
